<div class="content-section introduction">
    <div>
        <span class="feature-title">TabMenu</span>
        <span>Menu is a navigation/command component that displays items as tab headers.</span>
    </div>
</div>

<div class="content-section implementation">
    <p-tabMenu [model]="items"></p-tabMenu>
</div>

<div class="content-section documentation">
    <p-tabView effect="fade">
        <p-tabPanel header="Documentation">
            <h3>Import</h3>
<pre>
<code class="language-typescript" pCode ngNonBindable>
import &#123;TabMenuModule,MenuItem&#125; from 'primeng/primeng';
</code>
</pre>

            <h3>MenuModel API</h3>
            <p>TabMenu uses the common menumodel api to define its items, visit <a [routerLink]="['/menumodel']">MenuModel API</a> for details.</p>

            <h3>Getting Started</h3>
            <p>TabMenu requires a collection of menuitems as its model.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-tabMenu [model]="items"&gt;&lt;/p-tabMenu&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class TabMenuDemo &#123;
    
    items: MenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;label: 'Stats', icon: 'fa-bar-chart'&#125;,
            &#123;label: 'Calendar', icon: 'fa-calendar'&#125;,
            &#123;label: 'Documentation', icon: 'fa-book'&#125;,
            &#123;label: 'Support', icon: 'fa-support'&#125;,
            &#123;label: 'Social', icon: 'fa-twitter'&#125;
        ];
    &#125;
&#125;
</code>
</pre>

            <h3>ActiveItem</h3>
            <p>By default, first item is activated, use activeItem property to choose the initial active item.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-tabMenu [model]="items" [activeItem]="activeItem"&gt;&lt;/p-tabMenu&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class TabMenuDemo &#123;
    
    items: MenuItem[];
    
    activeItem: MenuItem;

    ngOnInit() &#123;
        this.items = [
            &#123;label: 'Stats', icon: 'fa-bar-chart'&#125;,
            &#123;label: 'Calendar', icon: 'fa-calendar'&#125;,
            &#123;label: 'Documentation', icon: 'fa-book'&#125;,
            &#123;label: 'Support', icon: 'fa-support'&#125;,
            &#123;label: 'Social', icon: 'fa-twitter'&#125;
        ];
        
        this.activeItem = this.items[2];
    &#125;
&#125;
</code>
</pre>

            <h3>Properties</h3>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Type</th>
                        <th>Default</th>
                        <th>Description</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>model</td>
                            <td>array</td>
                            <td>null</td>
                            <td>An array of menuitems.</td>
                        </tr>
                        <tr>
                            <td>activeItem</td>
                            <td>MenuItem</td>
                            <td>null</td>
                            <td>Defines the default active menuitem</td>
                        </tr>
                        <tr>
                            <td>style</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Inline style of the component.</td>
                        </tr>
                        <tr>
                            <td>styleClass</td>
                            <td>string</td>
                            <td>null</td>
                            <td>Style class of the component.</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            
            <h3>Styling</h3>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Element</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>ui-tabmenu</td>
                            <td>Container element.</td>
                        </tr>
                        <tr>
                            <td>ui-tabmenu-nav</td>
                            <td>List element of headers.</td>
                        </tr>
                        <tr>
                            <td>ui-tabmenuitem</td>
                            <td>Menuitem element.</td>
                        </tr>
                        <tr>
                            <td>ui-menuitem-link</td>
                            <td>Link inside a menuitem.</td>
                        </tr>
                        <tr>
                            <td>ui-menuitem-text</td>
                            <td>Label of a menuitem.</td>
                        </tr>
                        <tr>
                            <td>ui-menuitem-icon</td>
                            <td>Icon of a menuitem.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Dependencies</h3>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/tabmenu" class="btn-viewsource" target="_blank">
                <i class="fa fa-github"></i>
                <span>View on GitHub</span>
            </a>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-tabMenu [model]="items"&gt;&lt;/p-tabMenu&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class TabMenuDemo &#123;
    
    items: MenuItem[];

    ngOnInit() &#123;
        this.items = [
            &#123;label: 'Stats', icon: 'fa-bar-chart'&#125;,
            &#123;label: 'Calendar', icon: 'fa-calendar'&#125;,
            &#123;label: 'Documentation', icon: 'fa-book'&#125;,
            &#123;label: 'Support', icon: 'fa-support'&#125;,
            &#123;label: 'Social', icon: 'fa-twitter'&#125;
        ];
    &#125;
&#125;
</code>
</pre>
        </p-tabPanel>
    </p-tabView>
</div>
